//
//  CUser.swift
//  JTYP
//
//  Created by Groot on 2017/12/5.
//  Copyright © 2017年 inspur. All rights reserved.
//
import ObjectMapper

class ShiroUser: Mappable, Codable {
    var corpId: Int = 0
    var corpName: String?
    var deptId: Int = 0
    var deptName: String?
    var id: Int = 0
    var loginName: String?
    var name: String?
    var roleList: [Int]?
    var roles: String?
    var subDeptIds: String?
    var subDepts: String?
    var subRoles: String?
    var subUsers: String?
    var superDepts: String?
    
    required init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        corpId    <- map["corpId"]
        corpName    <- map["corpName"]
        deptId    <- map["deptId"]
        deptName    <- map["deptName"]
        id    <- map["id"]
        loginName    <- map["loginName"]
        name    <- map["name"]
        roleList    <- map["roleList"]
        roles    <- map["roles"]
        subDeptIds    <- map["subDeptIds"]
        subDepts    <- map["subDepts"]
        subRoles    <- map["subRoles"]
        subUsers    <- map["subUsers"]
        superDepts    <- map["superDepts"]
    }
}

//MARK: - userInfo -

class UserInfo: Mappable, Codable{
    var age: Int = 0
    var birthday: String?
    var bmi: CGFloat = 0
    var height: Int = 0
    var mode: Int = 0
    var phone: String?
    var photo: Int = 0
    var photourl: String?
    var profession: Int = 0
    var qq: String?
    var retire: Int = 0
    var sex: Int = 0
    var step: Int = 0
    var weight: Int = 0
    var weixin: String?
    
    required init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        age        <- map["age"]
        birthday   <- map["birthday"]
        bmi        <- map["bmi"]
        height     <- map["height"]
        mode       <- map["mode"]
        phone      <- map["phone"]
        photo      <- map["photo"]
        photourl   <- map["photourl"]
        profession <- map["profession"]
        qq         <- map["qq"]
        retire     <- map["retire"]
        sex        <- map["sex"]
        step       <- map["step"]
        weight     <- map["weight"]
        weixin     <- map["weixin"]
    }

}

class CUser: Mappable, Codable {
    var accessToken: String?
    var expiresIn: Int = 0
    var mode: Int = 0
    var modename: String?
    var refreshInterval: Int = 0
    var refreshToken: String?
    var shiroUser: ShiroUser?
    var step: Int = 0
    var tokenType: String?
    var userInfo: UserInfo?
    required init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        accessToken     <- map["accessToken"]
        expiresIn       <- map["expiresIn"]
        mode            <- map["mode"]
        modename        <- map["modename"]
        refreshInterval <- map["refreshInterval"]
        refreshToken    <- map["refreshToken"]
        shiroUser       <- map["shiroUser"]
        step            <- map["step"]
        tokenType       <- map["tokenType"]
        userInfo        <- map["userInfo"]
    }
    
}
